package com.lab.spring;

import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * User: bsceran
 * Date: 5/21/13
 * Time: 11:40 AM
 * To change this template use File | Settings | File Templates.
 */
public class DatePrefixGenerator implements PrefixGenerator {
    private DateFormat pattern;

    public void setPattern(String pattern) {
        this.pattern = new SimpleDateFormat(pattern);
    }

    @Override
    public String generatePrefix() {
        return pattern.format(new Date());
    }
}
